﻿using System;

namespace Cpuss
{
    /// <summary>
    /// Base class for all events fired by <see cref="Process"/>.
    /// </summary>
    public abstract class ProcessEventArgs : EventArgs
    {
        private readonly int _arrivalTime;
        private readonly int _burstTime;
        private readonly int _id;
        private readonly Priority _priority;

        /// <summary>
        /// Initializes a new instance of <see cref="ProcessEventArgs"/>.
        /// </summary>
        /// <param name="id">Id of process.</param>
        /// <param name="burstTime">Burst time of process.</param>
        /// <param name="arrivalTime">Arrival time of process.</param>
        /// <param name="priority">Priority of process.</param>
        protected ProcessEventArgs(int id, int burstTime, int arrivalTime, Priority priority)
        {
            _id = id;
            _burstTime = burstTime;
            _arrivalTime = arrivalTime;
            _priority = priority;
        }

        /// <summary>
        /// Gets the Id of the process.
        /// </summary>
        public int Id
        {
            get { return _id; }
        }

        /// <summary>
        /// Gets the burst time of the process.
        /// </summary>
        public int BurstTime
        {
            get { return _burstTime; }
        }

        /// <summary>
        /// Gets the arrival time of the process.
        /// </summary>
        public int ArrivalTime
        {
            get { return _arrivalTime; }
        }

        /// <summary>
        /// Gets the <see cref="Priority"/> of the process.
        /// </summary>
        public Priority Priority
        {
            get { return _priority; }
        }
    }
}